package com.corhyfar.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class SQLConnection {

	@SuppressWarnings("finally")
	public static Connection GetConnection() {
		Connection conexion = null;

		try {
			Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
			String url = "jdbc:sqlserver://localhost;databaseName=BDCORHYFAR;user=sa;password=sql;";
			conexion = DriverManager.getConnection(url);
		} catch (ClassNotFoundException ex) {
			System.out.println(ex);
		} catch (SQLException ex) {
			System.out.println(ex);
		} catch (Exception ex) {
			System.out.println(ex);
		} finally {
			return conexion;
		}
	}

}
